using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace Cpsc481Phone.Gui.Call
{
    public partial class hank_connected : UserControl
    {
        private int seconds = 0;
        private int minutes = 0;

        public hank_connected()
        {
            InitializeComponent();          
        }
        
        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void timer1_Tick(object sender, EventArgs e)
        {

            if (seconds < 60)
                seconds++;
            else
            {
                seconds = 0;
                minutes++;
            }
            String secondString = ":" + seconds;
            if(seconds<10)
                secondString = ":0" + seconds;

            String minuteString = ":" + minutes;
            if (minutes < 10)
                minuteString = ":0" + minutes;
            label4.Text = "00" + minuteString + secondString;
        }
        public String getTime()
        {
            
            if(minutes >= 10)
            return "00:" + minutes + ":" + seconds;
            else
            return "00:0" + minutes + ":" + seconds;
        }
        public void initTime()
        {
            seconds = 0;
            minutes = 0;
            label4.Text = "00:00:00";
        }
        public void stopCall()
        {
            timer1.Enabled = false;
        }
    }
}
